<!DOCTYPE html>
<html lang="zh-CN">

	<head>
		<meta charset="utf-8">
		<title>根据城市设置城市中心点</title>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
		<meta name="viewport" content="initial-scale=1.0, user-scalable=no">
		<meta http-equiv="X-UA-Compatible" content="IE=Edge">
		<style>
			body,
			html,
			#container {
				overflow: hidden;
				width: 100%;
				height: 100%;
				margin: 0;
				font-family: "微软雅黑";
			}
		</style>
		<script src="//api.map.baidu.com/api?type=webgl&v=1.0&ak=CQ6PQayAcUMTO41vSdIRSsp0l2YYPyg4"></script>
	</head>

	<body>
		<div id="container"></div>
	</body>

</html>
<script>
	var datas = {
		"status": 200,
		"description": "请求成功",
		"body": [{
				"label": "朝阳",
				"value": "AREA|69cc5f6d-4f29-a77c",
				"coord": {
					"latitude": "39.912338",
					"longitude": "116.449979"
				},
				"count": 567
			},
			{
				"label": "丰台",
				"value": "AREA|0dd58113-90ab-4d85",
				"coord": {
					"latitude": "39.858097",
					"longitude": "116.292081"
				},
				"count": 198
			},
			{
				"label": "西城",
				"value": "AREA|fdb2a2a2-519c-9cf7",
				"coord": {
					"latitude": "39.958385",
					"longitude": "116.399275"
				},
				"count": 301
			},
			{
				"label": "海淀",
				"value": "AREA|6524c161-1f81-d73c",
				"coord": {
					"latitude": "39.935122",
					"longitude": "116.28592"
				},
				"count": 305
			},
			{
				"label": "昌平",
				"value": "AREA|6cf8e88f-1e1f-e395",
				"coord": {
					"latitude": "40.225155",
					"longitude": "116.250886"
				},
				"count": 34
			},
			{
				"label": "通州",
				"value": "AREA|c3ec1269-459e-491c",
				"coord": {
					"latitude": "39.90911",
					"longitude": "116.642238"
				},
				"count": 87
			},
			{
				"label": "石景山",
				"value": "AREA|7253a8eb-dea5-a522",
				"coord": {
					"latitude": "39.937331",
					"longitude": "116.171857"
				},
				"count": 31
			},
			{
				"label": "顺义",
				"value": "AREA|509dc430-5a85-1a1a",
				"coord": {
					"latitude": "40.137571",
					"longitude": "116.648422"
				},
				"count": 35
			},
			{
				"label": "大兴",
				"value": "AREA|d4d85a7b-712f-fd9d",
				"coord": {
					"latitude": "39.770444",
					"longitude": "116.344335"
				},
				"count": 73
			},
			{
				"label": "房山",
				"value": "AREA|56c2a821-73c2-1c1f",
				"coord": {
					"latitude": "39.765558",
					"longitude": "116.213828"
				},
				"count": 34
			},
			{
				"label": "亦庄开发区",
				"value": "AREA|f46287e7-3d9e-fbf6",
				"coord": {
					"latitude": "39.784679",
					"longitude": "116.561137"
				},
				"count": 12
			},
			{
				"label": "门头沟",
				"value": "AREA|cb61da76-ef85-ad84",
				"coord": {
					"latitude": "39.918834",
					"longitude": "116.121948"
				},
				"count": 6
			}
		]
	}
	var zbs = datas.body;
	var map = new BMapGL.Map('container'); // 创建Map实例
	map.centerAndZoom('北京市', 12); // 初始化地图,设置中心点坐标和地图级别
	map.enableScrollWheelZoom(true); // 开启鼠标滚轮缩放
	//	   "latitude": "39.912338",
	//      "longitude": "116.449979"
	
	for (var i=0;i<datas.body.length;i++) {
		var longt = datas.body[i].coord.longitude;
		var lat = datas.body[i].coord.latitude;
		 creatCircle(longt,lat)
	}
	
	// 创建位置点
	function creatCircle(longt,lat) {
		var point = new BMapGL.Point(longt,lat);
		// 创建带高度的点
		var marker3d = new BMapGL.Marker3D(point, 8000, {
			size: 50,
			shape: BMAP_SHAPE_CIRCLE,
			fillColor: '#454399',
			fillOpacity: 0.6,
			
		});
		// 将点添加到地图上
		map.addOverlay(marker3d);
	}
</script>